package com.smalljj.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.smalljj.service.ArticleService;

import finaler.util.Page;
import finaler.util.PageList;

@Controller
@RequestMapping("article")
public class ArticleController {

	@Autowired
	private ArticleService articleService;

	
	@RequestMapping( value="/list",method=RequestMethod.GET )
    @ResponseBody
	public Object list(HttpServletRequest request) throws Exception {
		Page page  = new Page(request);
		PageList articleList = articleService.getList(page);
		return articleList;
	}

}